package com.example.demo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.jian.java.bean.User;
import com.jian.java.inter.UserConsumer;
import com.jian.java.inter.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jiange
 * @create 2021-05-23-19:59
 */
@RestController
public class MyController {
    @Reference(loadbalance = "")
    UserService userService;

    @Autowired
    UserConsumer userConsumer;

    @GetMapping("/jian")
    public String Get(User user){
        System.out.println(user);
        System.out.println(userService.getAge(user));
        System.out.println(userConsumer.getName(user));
        return userConsumer.getName(user);
    }
}
